package com.wcar.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName tb_store_evaluate
 */
@TableName(value ="tb_store_evaluate")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StoreEvaluate implements Serializable {
    /**
     * 门店评价ID，主键
     */
    @TableId(type = IdType.AUTO)
    private Integer evaluateId;

    /**
     * 外键关联门店表
     */
    private Integer storeId;

    /**
     * 评价人关联用户表
     */
    private String userId;

    /**
     * 评价内容
     */
    private String content;

    /**
     * 评价时间
     */
    private String evaluateTime;

    /**
     * 图片（查询有图评论时，判断该字段是否为空）
     */
    private String picture;

    /**
     * 星级(4，5 为好评 3 中评 2,1 差评)
     */
    @TableField(exist = false)
    private Integer avg;
    private Integer star;
    private Integer orderId;

    @TableField(exist = false)
    private Store store;
    @TableField(exist = false)
    private FrontUser frontUser;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 门店评价ID，主键
     */
    public Integer getEvaluateId() {
        return evaluateId;
    }

    /**
     * 门店评价ID，主键
     */
    public void setEvaluateId(Integer evaluateId) {
        this.evaluateId = evaluateId;
    }

    /**
     * 外键关联门店表
     */
    public Integer getStoreId() {
        return storeId;
    }

    /**
     * 外键关联门店表
     */
    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    /**
     * 评价人关联用户表
     */
    public String getUserId() {
        return userId;
    }

    /**
     * 评价人关联用户表
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /**
     * 评价内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 评价内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 评价时间
     */


    /**
     * 图片（查询有图评论时，判断该字段是否为空）
     */
    public String getPicture() {
        return picture;
    }

    /**
     * 图片（查询有图评论时，判断该字段是否为空）
     */
    public void setPicture(String picture) {
        this.picture = picture;
    }

    /**
     * 星级(4，5 为好评 3 中评 2,1 差评)
     */
    public Integer getStar() {
        return star;
    }

    /**
     * 星级(4，5 为好评 3 中评 2,1 差评)
     */
    public void setStar(Integer star) {
        this.star = star;
    }


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StoreEvaluate other = (StoreEvaluate) that;
        return (this.getEvaluateId() == null ? other.getEvaluateId() == null : this.getEvaluateId().equals(other.getEvaluateId()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getEvaluateTime() == null ? other.getEvaluateTime() == null : this.getEvaluateTime().equals(other.getEvaluateTime()))
            && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()))
            && (this.getStar() == null ? other.getStar() == null : this.getStar().equals(other.getStar()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEvaluateId() == null) ? 0 : getEvaluateId().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getEvaluateTime() == null) ? 0 : getEvaluateTime().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        result = prime * result + ((getStar() == null) ? 0 : getStar().hashCode());
        return result;
    }

}